#ifndef PICSCALE_H
#define PICSCALE_H
#include "ffplay_stater.h"
#include "imagescaler.h"
#include "ijkmp.h"
#include "libavresample/avresample.h"
//struct VideoFrame{
//    uint8_t *data[8] = {NULL};         // 类似FFmpeg的buf, 如果是
//    int32_t linesize[8] = {0};
//    int32_t width;
//    int32_t height;
//    int format = AV_PIX_FMT_YUV420P;
//};

class picscale
{
public:
    picscale();
    int init(uint32_t src_height,uint32_t src_wight ,int src_fmt, uint32_t dst_height,uint32_t dst_wight ,int dst_fmt);
    int sale(const Frame *src_frame,VideoFrame *dst_frame);
    ~picscale();
private:
    SwsContext *swr;
    int dst_height,dst_wight;
    int src_height,src_wight;
    AVPixelFormat src_fmt;
    AVPixelFormat dst_fmt;
    int algo_type = SWS_FAST_BILINEAR;
};

#endif // PICSCALE_H
